// Copyright [2020] <unknown>
#include <bits/stdc++.h>
using namespace std;
// #define ONLINE_JUDGE
#ifndef ONLINE_JUDGE
#define dbg(x...)                             \
    {                                         \
        cerr << "\033[32;1m" << #x << " -> "; \
        err(x);                               \
    }
void err() { cerr << "\033[39;0m" << endl; }
template <typename T, typename... A>
void err(T a, A... x) {
    cerr << a << ' ';
    err(x...);
}
#else
#define dbg(...)
#endif

#define sz(x) ((int)x.size())

typedef long long LL;
const int N = 2e5 + 50;

int t, n;

int d[2][N];

vector<int> G[N];
vector<int> useless;

void bfs(int s, int d[]) {
    memset(d, 0x3f3f3f3f, 4 * (n + 1));
    d[s] = 0;
    queue<int> Q;
    Q.push(s);
    while (!Q.empty()) {
        int u = Q.front();
        // dbg(u, d[u]);
        Q.pop();
        for (int v : G[u]) {
            if (d[v] > d[u] + 1) {
                d[v] = d[u] + 1;
                Q.push(v);
            }
        }
    }
}

bool flag[N];
vector<int> a;
int ans, k, m;
void update(int u, int v) {
    int x = min(d[0][u] + 1 + d[1][v], d[0][v] + 1 + d[1][u]);
    ans = max(ans, x);
}

bool cmp1(int a, int b) {
    return d[0][a] < d[0][b];
}
bool cmp2(int a, int b) {
    return d[1][a] < d[1][b];
}

int main(int argc, char const *argv[]) {
    // code
    scanf("%d%d%d", &n, &m, &k);
    a.resize(k);
    for (int i = 0; i < k; ++i) {
        scanf("%d", &a[i]);
    }

    for (int i = 0; i < m; ++i) {
        int u, v;
        scanf("%d%d", &u, &v);
        G[u].push_back(v);
        G[v].push_back(u);
    }

    bfs(1, d[0]);
    bfs(n, d[1]);
    sort(a.begin(), a.end(), cmp1);
    for (int i = 0; i < k; ++i)
        if (d[0][a[i]] + d[1][a[i]] > d[0][n])
            useless.push_back(a[i]);
    if (useless.size() > 2)
        update(useless[0], useless[1]);
    for (int i = 0; i < k - 1; ++i)
        update(a[i], a[i + 1]);
    sort(a.begin(), a.end(), cmp2);
    for (int i = 0; i < k - 1; ++i)
        update(a[i], a[i + 1]);
    ans = min(ans, d[0][n]);
    printf("%d\n", ans);
    return 0;
}
